package com.sopaths.utility.properties;

import java.io.IOException;
import java.net.URL;
import java.util.Properties;

public class ApplicationProperties {
	private static final String APPLICATION_PROPERTIES = "application.properties";

	private static Properties config;

	static {
		if (null == config) {
			config = new Properties();
			URL resourceFiLeUrl = Thread.currentThread()
					.getContextClassLoader()
					.getResource(APPLICATION_PROPERTIES);
			try {
				config.load(resourceFiLeUrl.openStream());
			} catch (IOException e) {
				e.printStackTrace();
			}
		}
	}

	public static String getSolrDeltaImportURL() {
		return config.getProperty("solr.delta.import");
	}

	public static String getSolrServerIp() {
		String solrServerIp = config.getProperty("solr.server.ip");
		return solrServerIp;
	}

	public static String getSolrServerInstance() {
		String solrServerIp = config.getProperty("solr.server.instance");
		return solrServerIp;
	}

	public static String getSolrServerPort() {
		String solrServerIp = config.getProperty("solr.server.port");
		return solrServerIp;
	}

	public static String getSolrGeoLanguage() {
		String geoCodeLanguage = config.getProperty("solr.geo.language");
		return geoCodeLanguage;
	}
}
